"use strict"

import * as A from './actions/content-change'

import {reducers} from './reducers/content-change'

import {createStore} from 'redux'

const photos = window.USER_PHOTOS.map(t => ({
    id: t.id,
    thumb: t.path + '/105',
    status: 'uploaded',
    path: t.path
}))

export const store = createStore(
    reducers,
    {
        gallery: {photos,page: 0},
        card: {pages:[], activeIndex: 0, selectedPath: []},
        music: {search: {}, userUpload: {list: window.USER_SONGS}, rec: {list: window.REC_SONGS}, selected: window.MUSIC},
        mode: window.MODE,
        global: {cropperReady: false, map: window.MAP, $cropper: undefined, cover: window.COVER, savedPages: ''},
    },
    window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)